import emojiJson from './map'
export function encodeEmoji(str) {
  let pattern = /\[.*?\]/g
  let unicodeStr = str.replace(pattern, function(match) {
    if (emojiJson[match]) {
      return `<span class="small qqface ${emojiJson[match]}"></span>`
    } return match
  })
  return unicodeStr
}
